<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=.0">
  <title>演示vue3-component</title>
  <script src="../vue-3.0.11.js"></script>
  <style>
    a, h1{
      display: block;
    }
    #app{
      display: flex;
      flex-direction: column;
    }
    .container{
      margin: 20px;
      border: #eeeeee solid px;
    }
  </style>
</head>

<body>
  <div id="app">
    <div class="container">
      <h1>component</h1>
      <test></test>
    </div>    
  </div>
  <script>
    const { createApp, ref, computed } = Vue

    const app = {
      setup() {
        return {

        }
      }
    }

    const vm = createApp(app)
    vm.component('test',{
      template: '<div>hello</div>'
    })
    vm.mount('#app')
  </script>
</body>

</html>